//
//  AYMHomeController.m
//  QuickCure
//
//  Created by 徐绩 on 16/5/4.
//  Copyright © 2016年 ayumi. All rights reserved.
//

#import "AYMHomeController.h"

#import "SCLAlertView.h"

@interface AYMHomeController ()

@end

@implementation AYMHomeController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"马医一生";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self setupUI];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didbutton:) name:@"didButton" object:nil];
    

    
}

//通知的监听方法

-(void)didbutton:(NSNotification *)noti{
    
    Log(@"%@",noti.object);
    
    SCLAlertView *alert = [[SCLAlertView alloc] init];
    
    [alert showError:self title:@"错误" subTitle:@"请登录" closeButtonTitle:@"确定" duration:0.0f];
    
    
}

//通知使用完移除

-(void)dealloc{
    
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    
}

/**
 *  布局界面
 */
-(void)setupUI{

    AYMHomeBottomView *bottomView = [[AYMHomeBottomView alloc]init];
    [self.view addSubview:bottomView];
    
    AYMWeatherView *weatherView = [[AYMWeatherView alloc]init];
    [self.view addSubview:weatherView];
    
    AYMFamousDocView *famousDocView = [[AYMFamousDocView alloc]init];
    [self.view addSubview:famousDocView];
    
    [weatherView makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.leading.trailing.equalTo(self.view);
        make.height.equalTo(80);
    }];
    
    [bottomView makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.bottom.equalTo(self.view);
        make.height.equalTo(280);
    }];
    
    [famousDocView makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.equalTo(bottomView.top);
        make.leading.trailing.equalTo(self.view);
        make.height.equalTo(40);
    }];

}

/**
 *  点击主页导航栏左边item
 */
-(void)didClickLeftItem{





}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
